package com.desktop.click.tool.util;

import com.desktop.click.tool.entity.RobotClickProperties;

import java.util.Vector;

public class TableDataUtil {
    private static Vector vector;

    public static void clear() {
        vector.clear();
    }

    public static Vector getTableTitle() {
        Vector vector = new Vector();
        vector.add("点击位置名称");
        vector.add("横坐标");
        vector.add("纵坐标");
        vector.add("点击间隔时间");
        return vector;
    }

    public static Vector getTableData(Vector<RobotClickProperties> properties) {
        if (vector == null) {
            vector = new Vector();
        }
        if (properties != null) {
            properties.forEach(p -> {
                Vector item = new Vector();
                item.add(p.getName());
                item.add(p.getX());
                item.add(p.getY());
                item.add(p.getDelay());
                vector.add(item);

            });
        }
        return vector;

    }
}
